<{include file="header.tpl"}>
    <div class="comBox">
        <div class="comHeader">
            <form action="" method="GET">
                <input type="hidden" name="ct" value="<{request_em key='ct'}>" />
                <input type="hidden" name="ac" value="<{request_em key='ac'}>" />
                <b>关键字：</b>
                <input type='text' name='keyword' style='width:200px;' class='txt' value="<{request_em key='keyword'}>" />
                <input type="submit" value="搜索" class="sub" /> 
                <span class="text-hint normal" style="margin-top:2px">服务器时间: <font id="time" color="green"><{$ns|date_format:"%Y-%m-%d %H:%M:%S"}></font> (用于参考设置任务执行时间)</span>
                <script type="text/javascript">
                    var ns = <{$ns}>*1000;//数字要*1000，因为js是毫秒数！
                    disptime(ns);
                    function disptime(ns)
                    {
                        time = formatDate(ns);
                        $('#time').html(time);
                        ns_next = parseInt(ns)+1000;//数字要*1000，因为js是毫秒数！
                        var Mytime=setTimeout("disptime(ns_next)", 1000);
                    }
                    function formatDate(ns)
                    {
                        var time = new Date(ns);
                        var year = time.getFullYear();
                        var month = time.getMonth()+1;
                        var date = time.getDate();
                        var hour = time.getHours();
                        var minute = time.getMinutes();
                        var second = time.getSeconds();
                        /*判断是不是要前置补零，一般情况下补零，不解释*/
                        if(month<10)
                            month = "0"+month;
                        if(date<10)
                            date = "0"+date;
                        if(hour<10)
                            hour = "0"+hour;
                        if(minute<10)
                            minute = "0"+minute;
                        if(second<10)
                            second = "0"+second;
                        return year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
                    }
                </script>
            </form>
        </div>
        <div class="comTable">
            <form action="" method="POST" id="form1">
            <table class="tableSort">
                <tr class="title">
                    <td width="20"> ID </td>
                    <td> 任务名 </td>
                    <td> 任务脚本 </td>
                    <td> 上次执行时间 </td>
                    <td> 上次运行时间 </td>
                    <td> 执行时间格式 </td>
                    <td align="center"> 有效性 </td>
                    <td width="120"> 管理 </td>
                </tr>
                <{if !empty($list)}>
                <{foreach from=$list item=v}>
                <tr>
                    <td> <{$v.id}> </td>
                    <td> <{$v.name}> </td>
                    <td> <pre><{$v.filename}></pre> </td>
                    <td> <{if !$v.lasttime}><font color="red">尚未执行</font><{else}><{$v.lasttime|date_format:"%Y-%m-%d %H:%M:%S"}><{/if}> </td>
                    <td> <{$v.runtime}> </td>
                    <td> <{$v.runtime_format}> </td>
                    <td align="center"> <{if $v.status}><font color="green">有效</font><{else}><font color="red">无效</font><{/if}> </td>
                    <td>
                        <a href="?ct=task&ac=edit&id=<{$v.id}>" class="edit">修改</a>
                        <a href="?ct=task&ac=del&id=<{$v.id}>" class="delete" onclick="return confirm('确定删除?')">删除</a>
                    </td>
                </tr>
                <{/foreach}>
                <{/if}>
                <tr>
                    <td colspan="11" class="tl">
                        <div class="fl">
                        </div>
                        <div class="pages fr">
                        </div>
                    </td>
                </tr>
            </table>
            </form>
        </div>
    </div>
<{include file="footer.tpl"}>
